import { ref } from 'vue'
import { defineStore } from 'pinia'
import { RequestAxios } from '@/utils/axios'


export const useFansListInfoStore = defineStore('fansListInfo', () => {
    const fansList = ref([] as IFansOrFocusData[])
    const fansTextList = ref<string[]>([])
    const switchFansList = ref<boolean[]>([])
    const getFansList = async (path: string, page: number) => {
        const res = await RequestAxios<IListRes>({
          url: path,
          method: 'get',
          params: {
            page: page,
            per_page: 100
          }
        })
        fansList.value = res.data.data.results
        fansList.value.forEach(() => {
          fansTextList.value.push("互相关注")
          switchFansList.value.push(false)
        })
      }

      getFansList('/v1_0/user/followers', 1)

  return { fansList, fansTextList, switchFansList}
})